//
//  ChargingInfoCell.m
//  云律司
//
//  Created by 韦淋 on 2017/7/4.
//  Copyright © 2017年 test. All rights reserved.
//

#import "ChargingInfoCell.h"

@implementation ChargingInfoCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self initalizeInterface];
    }
    return self;
}
- (void)initalizeInterface{
    [self.contentView addSubview:self.bgView];
    [self.bgView addSubview:self.lineView];
    [self.bgView addSubview:self.chargeType];
    [self.bgView addSubview:self.paymentDate];
    [self.bgView addSubview:self.incomeLable];
    [self.bgView addSubview:self.paymentWay];
    [self.bgView addSubview:self.statusLable];
    [self.bgView addSubview:self.auditorsLable];
}
- (void)layoutSubviews{
    
    
    self.bgView.frame = CGRectMake(5, 0, self.contentView.bounds.size.width - 10, self.contentView.bounds.size.height - 15);
    self.lineView.frame = CGRectMake(0, 0, self.bgView.bounds.size.width , 2);
    self.chargeType.frame = CGRectMake(40, 0, 350, 30);
    self.paymentDate.frame = CGRectMake(40, 30, 350, 30);
    self.incomeLable.frame = CGRectMake(40, 60, 350, 30);
    self.paymentWay.frame = CGRectMake(40, 90, 350, 30);
    self.statusLable.frame = CGRectMake(40, 120, 350, 30);
    self.auditorsLable.frame = CGRectMake(40, 150, 350, 30);
    for (int i = 0; i < 6; i ++) {
        UIView *dividerView = [[UIView alloc] initWithFrame:CGRectMake(0, i * 30, self.bgView.bounds.size.width , 0.5)];
        dividerView.backgroundColor = [UIColor colorWithRed:238.0f/255.0f green:238.0f/255.0f blue:238.0f/255.0f alpha:1.0f];
        [self.bgView addSubview:dividerView];
        
        NSArray *array = [NSArray array];
        array = @[@"llist_003",@"llist_004",@"llist_005",@"llist_006",@"llist_007",@"llist_007"];
        UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 5 + i * 30, 20, 20)];
        imageView.image = [UIImage imageNamed:array[i]];
        
        [self.bgView addSubview:imageView];
    }
    
    
}

- (UIView *)bgView{
    if (!_bgView) {
        _bgView = [[UIView alloc] init];
        _bgView.backgroundColor = [UIColor colorWithRed:248.0f/255.0f green:248.0f/255.0f blue:248.0f/255.0f alpha:1.0f];
        _bgView.layer.shadowColor=[UIColor lightGrayColor].CGColor;
        _bgView.layer.shadowOffset=CGSizeMake(3, 3);
        _bgView.layer.shadowOpacity=0.5;
    }
    return _bgView;
}
- (UIView *)lineView{
    if (!_lineView) {
        _lineView = [[UIView alloc] init];
        _lineView.backgroundColor = [UIColor colorWithRed:63.0f/255.0f green:189.0f/255.0f blue:240.0f/255.0f alpha:1.0f];
    }
    return _lineView;
}
- (UILabel *)chargeType{
    if (!_chargeType) {
        _chargeType = [[UILabel alloc]init];
        _chargeType.textColor = [UIColor blackColor];
        _chargeType.font = [UIFont systemFontOfSize:11];
        _chargeType.numberOfLines = 2;
        _chargeType.lineBreakMode = NSLineBreakByTruncatingTail;
    }
    return _chargeType;
}
- (UILabel *)paymentDate{
    if (!_paymentDate) {
        _paymentDate = [[UILabel alloc]init];
        _paymentDate.textColor = [UIColor blackColor];
        _paymentDate.font = [UIFont systemFontOfSize:11];
    }
    return _paymentDate;
}

- (UILabel *)incomeLable{
    if (!_incomeLable) {
        _incomeLable = [[UILabel alloc]init];
        _incomeLable.textColor = [UIColor blackColor];
        _incomeLable.font = [UIFont systemFontOfSize:11];
    }
    return _incomeLable;
}
- (UILabel *)paymentWay{
    if (!_paymentWay) {
        _paymentWay = [[UILabel alloc]init];
        _paymentWay.textColor = [UIColor blackColor];
        _paymentWay.font = [UIFont systemFontOfSize:11];
    }
    return _paymentWay;
}

- (UILabel *)statusLable{
    if (!_statusLable) {
        _statusLable = [[UILabel alloc]init];
        _statusLable.textColor = [UIColor blackColor];
        _statusLable.font = [UIFont systemFontOfSize:11];
    }
    return _statusLable;
}
- (UILabel *)auditorsLable{
    if (!_auditorsLable) {
        _auditorsLable = [[UILabel alloc]init];
        _auditorsLable.textColor = [UIColor blackColor];
        _auditorsLable.font = [UIFont systemFontOfSize:11];
    }
    return _auditorsLable;
}

@end
